#data {
#for (i in 1:N) {
#	dem_var1[i]<-(1/dem_var[i])
#	dem_est[i]~dnorm(dem[i], dem_var1[i])
#	}
#}

model {
for (i in 1:N) {
	xbeta[i]<-a[id[i]]+dif[i]*b[1]+conflict[i]*b[2]+t[i]*b[3]
	
	logit(pr[i])<-xbeta[i]
	ccpr[i]~dbern(pr[i])
	}

for (i in 1:28) {
	a[i]~dnorm(mu.a[i], tau)
	mu.a[i]<-g[1]+common[i]*g[2]
	}

for (k in 1:3) {
	b[k]~dnorm(0,.1)
	}

for (j in 1:2) {
	g[j]~dnorm(0,.1)
	}

tau~dgamma(.1, 1)

}

